package stz.flash.option;

import stz.flash.main.BulbField;





public class Option {

	public static final int FLASHLIGHT_MODE = 0;
	public static final int STROBE_MODE = 1;

	private static Option option = new Option();
	private PersistentData data = PersistentData.getPersistentDatabase();

	private Option() {
	}

	public static Option getIns() {
		return option;
	}

	//App
	public int getLatestMode() {
		return data.getLatestMode();
	}
	public void setLatstMode(int mode) {
		data.setLatestMode(mode);
	}
	public String getSelectedStartupMode() {
		return data.getSelectedStartupMode();
	}
	public void setSelectedStartupMode(String selectedStartupMode) {
		data.setSelectedStartupMode(selectedStartupMode);
	}
	
	public boolean isVibration() {
		return data.isVibration();
	}
	public void setVibration(boolean startupVibration) {
		data.setVibration(startupVibration);
	}

	public boolean isBackgroundExecute() {
		return data.isBackgroundExecute();
	}
	public void setBackgroundExecute(boolean background) {
		data.setBackgroundExecute(background);
	}
	
	//Flashlight
	public void setTimerDuration(Integer duration){
		data.setTimerDuration(duration);
	}
	public Integer getTimerDuration(){
		return data.getTimerDuration();
	}
	
	//Strobe
	public boolean isVRFlashState() {
		return data.isVRFlashState();
	}
	public void setVRFlashState(boolean vrFlashState) {
		data.setVRFlashState(vrFlashState);
		BulbField.getIns().updateBulb();
	}
	
	public void setStrobeToggleKey(int strobeToggleKey) {
		data.setStrobeToggleKey(strobeToggleKey);
	}
	public int getStrobeToggleKey() {
		return data.getStrobeToggleKey();
	}
}
